package com.sctvcloud.dongqu.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ruihang.generalibrary.ui.adapter.BaseHolderAbsAdapter;
import com.ruihang.generalibrary.ui.util.OnItemInternalClick;
import com.sctvcloud.dongqu.R;
import com.sctvcloud.dongqu.beans.LinkItem;
import com.sctvcloud.dongqu.ui.adapter.holder.GovernmentHolder;
import com.sctvcloud.dongqu.ui.util.IListShowData;

import java.util.List;

/**
 * 政务大厅  适配器
 * @param <T>
 */
public class GovernmentCenterAdapter<T extends IListShowData> extends BaseHolderAbsAdapter<LinkItem, GovernmentHolder> {

    private boolean isAct = false;

    public GovernmentCenterAdapter(Context context, List<LinkItem> list ) {
        super(context, list);
    }

    public void setAct(boolean isAct) {
        this.isAct = isAct;
    }


    @Override
    public GovernmentHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_government, parent, false);
        GovernmentHolder holder = new GovernmentHolder(context, view);
        holder.setAct(isAct);
        holder.setType(viewType);
        holder.setInternalClick(this);
        return holder;
    }

    @Override
    public GovernmentCenterAdapter setItemInternalClick(OnItemInternalClick itemInternalClick) {
        super.setItemInternalClick(itemInternalClick);
        return this;
    }

    @Override
    public int getItemViewType(int position) {
        return 0;
    }
}
